function queryForm(pageIndex,pageSize)
{
     var url =base+"/reportMain/pagingInfo.do?pageIndex="+pageIndex+"&pageSize="+pageSize;
     var params =jQuery("#queryForm").serialize();
     params=decodeURIComponent(params,true); 
     jQuery("#reportContent").load(url+"&"+ encodeURI(encodeURI(params)));
}


function gotoPage(pageSize)
{
   var pageIndex =jQuery("#pageIndex").val();
   queryForm(pageIndex,pageSize);
}
var index=0;

jQuery(function()
  {
   var handlerurl =base+"/reportMain/getRepResult.do?repCode=getRepResultInfo";
   $.ajax({
    type: "POST",
    url: handlerurl,
    success: function(data){ 
            var data=eval("("+data+")");
            jQuery(data).each(function(index,obj)
             {
               jQuery("<option value='"+obj.id+"'>"+obj.lotteryName+"</option>").appendTo("#lotteryType");
             }
              );
          } 
       }
   ); 
   var startDateStr =DateUtil.dateToStr('yyyy-MM-dd');
   jQuery("#queryForm input[name='startDate']").val(startDateStr+" 00:00:00");
   queryForm(1,15);
  }
  );

function checkAll()
{ 
	changerStatus(index%2==0);
	index++;
}
 


function changerStatus(status)
{
	var betsList= document.getElementsByName("betsId");
	for(var i=0;i<betsList.length;i++)
    {
	   betsList[i].checked = status;	
	}
}


function cancelBet()
{
	var betsList = jQuery("input[type='checkbox'][name='betsId']:checked");
	if(betsList&&betsList.length>0)
	{
	   $.ajax({
			    type: "GET",
			    url: base+"/commBet/deleteCommBetBatch.do?"+jQuery("input[type='checkbox'][name='betsId']:checked").serialize(),
			    success: function(data){ 
			    	 var data=eval("("+data+")");
		             if(data.STATUS==0)
		             {
		            	 alert("撤单成功!");
		            	 queryForm(1, 15);
		             }
		             else
		             {
		            	 alert(data.MSG);
		             }
			      } 
			      }
		 ); 
	    return;	
	}
	alert("请选择你需要撤销的投注记录");

}



function showBetsDetail(id)
{
    var url=base+"/commBet/betsDetail.do?id="+id;
    jQuery.layer({
        type: 2, 
        border: [0], 
        shadeClose: true,
        closeBtn: true,
        title: false,
        shadeClose: true,
        closeBtn: true,
        iframe: {src : url},
        area: ['620px' , '418px'] 
       }); 
}
